#!/bin/bash

# 检查 landscape2 是否已安装
if ! command -v landscape2 &> /dev/null; then
    echo "错误: landscape2 未安装"
    exit 1
fi

# 检查 build 目录是否存在
if [ ! -d "build" ]; then
    echo "错误: build 目录不存在，请先运行 build_xxx.sh 构建项目"
    exit 1
fi

echo "正在启动 landscape 服务器..."
landscape2 serve --landscape-dir build

if [ $? -eq 0 ]; then
    echo "服务器已成功启动！"
else
    echo "服务器启动失败！"
    exit 1
fi